<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Materias</title>
        <link rel="stylesheet" type="text/css" href="style.css" media="screen"/>
        <script language="JavaScript" src="scripts/utilesAlumno.js"></script>
        <script language="JavaScript" src="scripts/utilesRendir.js"></script>
        <script language="JavaScript" src="scripts/modal.js"></script>        
    </head>
    
    <body>        
        <div id="container">
            <div id="header">
                <div id="headerLeft">
                    <h1><span style="color:#599EC8;">EXAMENES</span><br/>&nbsp;&nbsp;&nbsp;&nbsp;WEB</h1>
                </div>
                
                <form id="formSalir" name="formSalir" method="post" action="Control" class="formulario">
                    <div id="pass" align="right">
                        <a href="cambiaPassw.jsp" target="_new"><strong><font color="#000000">Cambiar contraseña</font></strong></a>
                        <input type="hidden" name="opcion" value="logout">
                        <input type="submit" name="logout" value="Logout"/>
                    </div>       
                </form>                                    
            </div>
        </div><br/>
        
        <c:if test="${usuActivo.nombre == null || usuActivo.tipoS != 'A'}">
             <div align=center>
                <strong><font color="#993300">Usted no se ha logueado apropiadamente.</font></strong><br/>
                <a>&nbsp;</a>
             </div>
        </c:if>  
      
        <c:if test="${usuActivo.nombre != null && usuActivo.tipoS == 'A'}">
            
            <div id="menu">
                <ul>
                    <form id="formBoton" name="formBoton" method="post" action="Control" class="formulario">
                        <input type="hidden" name="opcion" value="homeAlum">
                        <input type="hidden" name="idalumno" value="${usuActivo.idUsu}">
                        <input type="submit" name="cargar" value="Home" class="boton">
                    </form>
                    <li><a href="materiasAlumnos.jsp">Materias</a></li>
                </ul>
            </div>
            
            <c:if test="${param.msg == 'REGINCOM'}">
                <div align=center>
                    <strong><font color="#993300">Debe completar todos los campos requeridos.</font></strong><br/>
                    <a>&nbsp;</a>
                </div>
            </c:if>
            
            <c:if test="${param.msg == 'FAILCARG'}">
                <div align=center>
                    <strong><font color="#993300">Fallo la carga.</font></strong><br/>
                    <a>&nbsp;</a>
                </div>
            </c:if>
            
            <h1 id="title">Materias</h1>
            <br>
            
            <div id="materias" align="center">
                <h1 id="subtitle">Materias en Curso</h1>
                <br>
                <c:forEach var="mat" items="${materiasA}" >
                    <c:out value="${mat.columna1}"/>&nbsp;<c:out value="${mat.columna2}"/>                                           
                    <br>      
                </c:forEach>                               	                 
                <div id="div1" style="visibility:visible" align="right">
                    <h4 style="cursor:hand" align="center" onclick="mostrar('div2','div1')"> Ver materias restantes </h4>
                </div>	 
                
                <div id="div2" style="visibility:hidden">
                    <h1 id="subtitle">Materias Disponibles</h1>
                    <br>
                    <c:forEach var="resMat" items="${restMaterias}" >
                        <a href="matriMateria.jsp?materia=${resMat}">${resMat}</a>
                        <br>      
                    </c:forEach>
                    <h4 style="cursor:hand" align="center" onclick="ocultar('div2','div1')"> Ocultar materias </h4>		 
                </div>
                
                <div aling="left">
                    * Falta validar por el Administrador
                </div> 
            </div>
        </c:if> 
    </body>
</html>   